
<template>
    <div>
        <el-form-item label="链接方式" v-if="Object.keys(data.options).indexOf('linkType')>=0">
            <el-radio-group v-model="data.options.linkType">
                <el-radio-button label="inline">内链</el-radio-button>
                <el-radio-button label="outer">外链</el-radio-button>
            </el-radio-group>
        </el-form-item>
        <el-form-item label="链接地址" v-if="Object.keys(data.options).indexOf('linkUrl')>=0">
            <el-input v-model="data.options.linkUrl"/>
        </el-form-item>
        <el-form-item label="显示头像" v-if="Object.keys(data.options).indexOf('isShowAvatar')>=0">
            <el-switch v-model="data.options.isShowAvatar"/>
        </el-form-item>
        <el-form-item label="占位内容" v-if="Object.keys(data.options).indexOf('placeholder')>=0 && (data.type!='BaseDateTime')">
            <el-input v-model="data.options.placeholder"/>
        </el-form-item>
        <el-form-item label="绑定Key值">
            <el-input v-model="data.model"/>
        </el-form-item>
        <el-form-item label="操作属性">
            <el-checkbox v-model="data.options.readonly" v-if="Object.keys(data.options).indexOf('readonly')>=0">完全只读</el-checkbox>
            <el-checkbox v-model="data.options.disabled" v-if="Object.keys(data.options).indexOf('disabled')>=0">禁用	</el-checkbox>
            <el-checkbox v-model="data.options.editable" v-if="Object.keys(data.options).indexOf('editable')>=0">文本框可输入</el-checkbox>
            <el-checkbox v-model="data.options.clearable" v-if="Object.keys(data.options).indexOf('clearable')>=0">显示清除按钮</el-checkbox>
            <el-checkbox v-model="data.options.arrowControl" v-if="Object.keys(data.options).indexOf('arrowControl')>=0">使用箭头进行时间选择</el-checkbox>
        </el-form-item>
        <el-form-item label="校验">
            <div>
                <el-checkbox v-model="data.options.required">必填</el-checkbox>
            </div>
            <el-select v-if="Object.keys(data.options).indexOf('dataType')>=0" v-model="data.options.dataType" size="mini" >
                <el-option value="string" label="字符串"/>
                <el-option value="number" label="数字"/>
                <el-option value="boolean" label="布尔值"/>
                <el-option value="integer" label="整数"/>
                <el-option value="float" label="浮点数"/>
                <el-option value="url" label="URL地址"/>
                <el-option value="email" label="邮箱地址"/>
                <el-option value="hex" label="十六进制"/>
            </el-select>
            <div v-if="Object.keys(data.options).indexOf('pattern')>=0">
                <el-input size="mini" v-model.lazy="data.options.pattern" style=" width: 240px;" placeholder="填写正则表达式"/>
            </div>
        </el-form-item>
    </div>
</template>

<script>
export default {
    name: 'CommonSetConfig',
    props: {
        data: {
            type: Object
        }
    },
    methods: {

    }
}
</script>

